import request from '@/utils/request'
import {ProjectBuilderForm, ParamsType, ProjectBuilderListForm } from '@/api/manager/projectbuilder/types'

/**
 * 获取施工项目列表
 */
export function getProjectBuilderList(data: ParamsType) {
  return request({
    url: '/api/v1/manager/project/builder_page',
    method: 'get',
    params: data
  })
}

/**
 * 获取施工项目
 */
export function getProjectBuilderInfo(projectId: number) {
  return request({
    url: `api/v1/manager/project/${projectId}/projectbuilderform`,
    method: 'get',
  })
}

/**
 * 新增施工项目
 */
export function addProjectBuilder(data: ProjectBuilderForm) {
  return request({
    url: '/api/v1/manager/project/create_projectbuilder',
    method: 'post',
    data: data
  })
}

/**
 * 修改施工项目
 */
export function editProjectBuilder(id: number,data: ProjectBuilderForm) {
  return request({
    url: '/api/v1/manager/project/update_projectBuilder/'+id,
    method: 'put',
    data: data
  })
}

/**
 * 删除施工项目
 */
export function deleteProjectBuilder(id: number) {
  return request({
    url: '/api/v1/manager/project/delete_projectBuilder/'+id,
    method: 'delete',
  })
}